package com.education.welco.service;

import com.education.welco.pojo.OrderPaper;
import com.education.welco.pojo.TClass;
import com.education.welco.pojo.vo.OrderPaperAppVO;
import com.education.welco.pojo.vo.OrderPaperVo;

import java.util.List;

/**
 * 试卷表 服务层
 *
 * @author d
 * @date 2021-03-04 15:45:18
 */
public interface OrderPaperService {

    //查询试卷表信息
    public OrderPaper selectOrderPaperById(Integer id);

    //查询试卷表列表
    public List<OrderPaper> selectOrderPaperList(OrderPaper orderPaper);

    //新增试卷表
    public int insertOrderPaper(OrderPaper orderPaper);

    public int insertPaperTest(OrderPaperVo orderPaper);

    //修改试卷表
    public int updateOrderPaper(OrderPaper orderPaper);

    //删除试卷表信息
    public int deleteOrderPaperByIds(String[] ids);

    //删除试卷表
    public int deleteOrderPaperById(Integer id);

    public List<OrderPaper> selectOrderPaperList1();

    List<OrderPaper> selectOrderPaperStuList(OrderPaper orderPaper);

    List<Integer> selectOrderPaperStuListAll(OrderPaper orderPaper);

    List<Integer> selectOrderPaperStuListSome(String courseId, Integer stuId);

    List<OrderPaper> selectOrderPaperStuListOther(List<Integer> other);

    List<OrderPaper> paperListByTeacher(Integer teaId, String paperName, Integer examStatus, Integer pageNum, Integer pageSize);

    List<TClass> selectClassBypaperId(Integer paperId);

    List<TClass> selectClassByTopCatalogId(Integer topCatalogId);

    int selectWaitStudentPaperNumByTeaId(String teaId);

    /**
     * 根据二级目录查试卷(查询老师准备的某门课程下的全部试题列表)
     *
     * @param twoIntList 二级目录列表
     * @return
     */
    List<Integer> selectpaperIdByLessonIdTwo(List<Integer> twoIntList);

    /**
     * 班级和课程下试卷的中间关联表擦插入数据
     *
     * @param classId
     * @param paperIdList
     * @param teaId
     * @return
     */
    int insertClassPaper(Integer classId, List<Integer> paperIdList, Integer teaId);

    /**
     * 班级和课程下试卷的中间关联表擦插入数据
     *
     * @param classIdList 班级id集合
     * @param paperId     试卷id
     * @param teaId       老师用户id
     * @return
     */
    Integer insertClassPaper(List<Integer> classIdList, Integer paperId, String teaId);

    /**
     * 排除重复数据(根据老师id和班级id查找classpaper表得到paper列表)
     *
     * @param classId
     * @param teaId
     * @return
     */
    List<Integer> queryPaperIdByClassIdAndTeaIdFromClassPaper(Integer classId, Integer teaId);

    void clone(OrderPaper orderPaper) throws Exception;

    List<OrderPaperAppVO> selectPaperListForTea(Integer teaId);

    /**
     * 删除class_paper的关联记录 依据paperId
     *
     * @param paperId 试卷id
     * @return
     */
    int deleteClassPaperByPaperId(int paperId);
}